package com.ibiaoke.system.dao;

import com.ibiaoke.common.base.BaseDao;
import com.ibiaoke.common.consts.CommonConsts;
import com.ibiaoke.system.entity.AreaDistrict;
import com.ibiaoke.system.entity.AreaDistrictExample;
import com.ibiaoke.system.mapper.AreaDistrictMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by biaoke on 2017/6/25.
 */

@Repository
public class AreaDistrictDao extends BaseDao<AreaDistrict,AreaDistrictExample,Integer,AreaDistrictMapper> {
    @Autowired
    private AreaDistrictMapper areaDistrictMapper;
    @Override
    public AreaDistrictMapper getMapper() {
        return areaDistrictMapper;
    }

    public List<AreaDistrict> listDistrict() {
        AreaDistrictExample example = new AreaDistrictExample();
        example.createCriteria().andIsUsedEqualTo(CommonConsts.YES);
        return selectByExample(example);
    }
}